Release 10.1A: OpenEdge Development:
Programming Interfaces
Accessing the child nodes
Before you can work with a child node of an XML document, you must create a node reference object with which to access the node. Then you access the node by using the
GET-CHILD( )method. The following code fragment shows obtaining the third child node of the parent node,hParent:
Using node attributes and values
You can get information about the child node by using various attributes and methods. For example, if you do not know how many nodes there are below the node referred to by the node reference, you can use the
NUM-CHILDRENattribute. You can obtain or set the value of the node by using theNODE-VALUEattribute:
You can obtain a list of an element’s attribute names using the
ATTRIBUTE-NAMESattribute, get the value of an attribute by using theGET-ATTRIBUTE( )method or set the value of an attribute by using theSET-ATTRIBUTE( )method. You can alsoREMOVE-ATTRIBUTE( ):
In addition to creating nodes, you can
IMPORT-NODE( ),CLONE-NODE( ), andDELETE-NODE( ). In addition to appending and getting a child, you canREMOVE-CHILD( ),REPLACE-CHILD( ), andGET-PARENT( ). The following example demonstrates theCLONE-NODE( )method:
There are more methods and attributes that apply to the
X-documentobject and theX-noderefobjects. For more information on these attributes and methods, see their entries in the OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |